/*
Copyright 2014, KISSY v1.47
MIT Licensed
build time: Aug 28 13:31
*/
KISSY.add("dom/base/api",[],function(j){var m=j.Env.host||{},n=m.document,r=j.UA,d={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},e={isCustomDomain:function(d){var d=d||m,d=e.get(d),h=d.document.domain,d=d.location.hostname;return h!==d&&h!=="["+d+"]"},getEmptyIframeSrc:function(d){d=d||m;d=e.get(d);return r.ie&&e.isCustomDomain(d)?
"javascript:void(function(){"+encodeURIComponent('document.open();document.domain="'+d.document.domain+'";document.close();')+"}())":""},NodeType:d,getWindow:function(k){if(!k)return m;k=e.get(k);if(j.isWindow(k))return k;var h=k;h.nodeType!==d.DOCUMENT_NODE&&(h=k.ownerDocument);return h.defaultView||h.parentWindow},getDocument:function(k){if(!k)return n;k=e.get(k);return j.isWindow(k)?k.document:k.nodeType===d.DOCUMENT_NODE?k:k.ownerDocument},isDomNodeList:function(d){return d&&!d.nodeType&&d.item&&
!d.setTimeout},nodeName:function(d){var h=e.get(d),d=h.nodeName.toLowerCase();r.ie&&(h=h.scopeName)&&"HTML"!==h&&(d=h.toLowerCase()+":"+d);return d},_RE_NUM_NO_PX:RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i")};j.mix(e,d);return e});
KISSY.add("dom/base/attr",["./api"],function(j,m){function n(a){return null==a?"":a+""}function r(a,b){var b=g[b]||b,d=p[b];return d&&d.get?d.get(a,b):a[b]}var d=m("./api"),e=j.Env.host.document,k=d.NodeType,e=e&&e.documentElement,h=d.nodeName,f=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,i=/^(?:button|input|object|select|textarea)$/i,l=/^a(?:rea)?$/i,c=/:|^on/,b=/\r/g,a={},s={val:1,css:1,html:1,text:1,data:1,width:1,
height:1,offset:1,scrollTop:1,scrollLeft:1},t={tabindex:{get:function(a){var b=a.getAttributeNode("tabindex");return b&&b.specified?parseInt(b.value,10):i.test(a.nodeName)||l.test(a.nodeName)&&a.href?0:void 0}}},g={hidefocus:"hideFocus",tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},q=
{get:function(a,b){return d.prop(a,b)?b.toLowerCase():void 0},set:function(a,b,c){!1===b?d.removeAttr(a,c):(b=g[c]||c,b in a&&(a[b]=!0),a.setAttribute(c,c.toLowerCase()));return c}},p={},u={},z={select:{get:function(a){var b=a.selectedIndex,c=a.options,g;if(0>b)return null;if("select-one"===""+a.type)return d.val(c[b]);a=[];b=0;for(g=c.length;b<g;++b)c[b].selected&&a.push(d.val(c[b]));return a},set:function(a,b){var c=j.makeArray(b);j.each(a.options,function(a){a.selected=j.inArray(d.val(a),c)});
c.length||(a.selectedIndex=-1);return c}}};j.each(["radio","checkbox"],function(a){z[a]={get:function(a){return null===a.getAttribute("value")?"on":a.value},set:function(a,b){if(j.isArray(b))return a.checked=j.inArray(d.val(a),b),1}}});t.style={get:function(a){return a.style.cssText}};j.mix(d,{_valHooks:z,_propFix:g,_attrHooks:t,_propHooks:p,_attrNodeHook:u,_attrFix:a,prop:function(a,b,c){var f=d.query(a),h,e;if(j.isPlainObject(b))j.each(b,function(a,b){d.prop(f,b,a)});else if(b=g[b]||b,e=p[b],void 0!==
c)for(a=f.length-1;0<=a;a--)h=f[a],e&&e.set?e.set(h,c,b):h[b]=c;else if(f.length)return r(f[0],b)},hasProp:function(a,b){var c=d.query(a),g,f=c.length,h;for(g=0;g<f;g++)if(h=c[g],void 0!==r(h,b))return!0;return!1},removeProp:function(a,b){var b=g[b]||b,c=d.query(a),f,h;for(f=c.length-1;0<=f;f--){h=c[f];try{h[b]=void 0,delete h[b]}catch(e){}}},attr:function(b,g,e,i){var l=d.query(b),p=l[0];if(j.isPlainObject(g)){var i=e,o;for(o in g)d.attr(l,o,g[o],i)}else{if(i&&s[g])return d[g](b,e);g=g.toLowerCase();
if(i&&s[g])return d[g](b,e);g=a[g]||g;b=f.test(g)?q:c.test(g)?u:t[g];if(void 0===e){if(p&&p.nodeType===k.ELEMENT_NODE){"form"===h(p)&&(b=u);if(b&&b.get)return b.get(p,g);e=p.getAttribute(g);return""===e&&(g=p.getAttributeNode(g),!g||!g.specified)?void 0:null===e?void 0:e}}else for(i=l.length-1;0<=i;i--)if((p=l[i])&&p.nodeType===k.ELEMENT_NODE)"form"===h(p)&&(b=u),b&&b.set?b.set(p,e,g):p.setAttribute(g,""+e)}},removeAttr:function(b,c){var c=c.toLowerCase(),c=a[c]||c,h=d.query(b),e,s,q;for(q=h.length-
1;0<=q;q--)if(s=h[q],s.nodeType===k.ELEMENT_NODE&&(s.removeAttribute(c),f.test(c)&&(e=g[c]||c)in s))s[e]=!1},hasAttr:e&&!e.hasAttribute?function(b,a){var a=a.toLowerCase(),c=d.query(b),g,f;for(g=0;g<c.length;g++)if(f=c[g],(f=f.getAttributeNode(a))&&f.specified)return!0;return!1}:function(a,b){var c=d.query(a),g,f=c.length;for(g=0;g<f;g++)if(c[g].hasAttribute(b))return!0;return!1},val:function(a,c){var g,f,e,s,o;if(void 0===c){if(e=d.get(a)){if((g=z[h(e)]||z[e.type])&&"get"in g&&void 0!==(f=g.get(e,
"value")))return f;f=e.value;return"string"===typeof f?f.replace(b,""):null==f?"":f}}else{f=d.query(a);for(s=f.length-1;0<=s;s--){e=f[s];if(1!==e.nodeType)break;o=c;null==o?o="":"number"===typeof o?o+="":j.isArray(o)&&(o=j.map(o,n));g=z[h(e)]||z[e.type];if(!g||!("set"in g)||void 0===g.set(e,o,"value"))e.value=o}}},text:function(a,b){var g,c,f,e;if(void 0===b)return g=d.get(a),d._getText(g);c=d.query(a);for(f=c.length-1;0<=f;f--)if(g=c[f],e=g.nodeType,e===k.ELEMENT_NODE)d.cleanData(g.getElementsByTagName("*")),
"textContent"in g?g.textContent=b:g.innerText=b;else if(e===k.TEXT_NODE||e===k.CDATA_SECTION_NODE)g.nodeValue=b},_getText:function(a){return a.textContent}});return d});
KISSY.add("dom/base/class",["./api"],function(j,m){function n(d){for(var d=j.trim(d||""),d=d.split(f),e=[],c,b=d.length,a=0;a<b;a++)(c=d[a])&&e.push(c);return e}function r(d){return function(f,c){var b,a,e,h=f.classList,g=k.call(arguments,2);b=0;for(a=c.length;b<a;b++)(e=c[b])&&h[d].apply(h,[e].concat(g))}}function d(d){return function(f,c){var b=n(c),a=k.call(arguments,2);e.query(f).each(function(c){c.nodeType===h.ELEMENT_NODE&&e[d].apply(e,[c,b].concat(a))})}}var e=m("./api"),k=[].slice,h=e.NodeType,
f=/[\.\s]\s*\.?/;j.mix(e,{_hasClass:function(d,f){var c,b,a,e=d.classList;if(e.length){c=0;for(b=f.length;c<b;c++)if((a=f[c])&&!e.contains(a))return!1;return!0}return!1},_addClass:r("add"),_removeClass:r("remove"),_toggleClass:r("toggle"),hasClass:function(d,f){var c=!1,f=n(f);e.query(d).each(function(b){if(b.nodeType===h.ELEMENT_NODE&&e._hasClass(b,f))return c=!0,!1});return c},replaceClass:function(d,f,c){e.removeClass(d,f);e.addClass(d,c)},addClass:d("_addClass"),removeClass:d("_removeClass"),
toggleClass:d("_toggleClass")});return e});
KISSY.add("dom/base/create",["./api"],function(j,m){function n(o){o=o&&o!==i?o.createElement(b):a;o===a&&(o.innerHTML="");return o}function r(a,b){var d=n(b);d.innerHTML="m<div>"+a+"</div>";return d.lastChild}function d(a,b){if(b)if(p&&b.canHaveChildren&&"removeNode"in a){if(a.firstChild)a:{try{a.innerHTML="";break a}catch(g){}for(var c;c=a.lastChild;)d(c,a)}a.removeNode(!1)}else b.removeChild(a)}function e(a,b,d){var g=b.nodeType;if(g===l.DOCUMENT_FRAGMENT_NODE){b=b.childNodes;d=d.childNodes;for(g=
0;b[g];)d[g]&&e(a,b[g],d[g]),g++}else if(g===l.ELEMENT_NODE){b=b.getElementsByTagName("*");d=d.getElementsByTagName("*");for(g=0;b[g];)d[g]&&a(b[g],d[g]),g++}}function k(a,b){var g=j.Env.mods["event/dom/base"],d,c,g=g&&g.exports;if(b.nodeType!==l.ELEMENT_NODE||f.hasData(a)){d=f.data(a);for(c in d)f.data(b,c,d[c]);g&&g.clone&&g.clone(a,b)}}function h(a){var b=null,g,d;if(a&&(a.push||a.item)&&a[0]){b=a[0].ownerDocument;b=b.createDocumentFragment();a=j.makeArray(a);g=0;for(d=a.length;g<d;g++)b.appendChild(a[g])}return b}
var f=m("./api"),i=j.Env.host.document,l=f.NodeType,c=j.UA.ieMode,b="div",a=i&&i.createElement(b),s=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,t=/<([\w:]+)/,g=/^\s+/,q=/\s+$/,p=!!(c&&9>c),u=p,z=/<|&#?\w+;/,A=i&&"outerHTML"in i.documentElement,F=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;j.mix(f,{create:function(a,d,c,e){var p=null;if(!a)return p;if(a.nodeType)return f.clone(a);if("string"!==typeof a)return p;void 0===e&&(e=!0);e&&(a=j.trim(a));var e=f._creators,k,n,c=c||i,A,m=b;if(z.test(a))if(A=
F.exec(a))p=c.createElement(A[1]);else{a=a.replace(s,"<$1></$2>");if((A=t.exec(a))&&(k=A[1]))m=k.toLowerCase();k=(e[m]||r)(a,c);u&&(n=a.match(g))&&k.insertBefore(c.createTextNode(n[0]),k.firstChild);u&&/\S/.test(a)&&(n=a.match(q))&&k.appendChild(c.createTextNode(n[0]));a=k.childNodes;1===a.length?p=a[0].parentNode.removeChild(a[0]):a.length&&(p=h(a))}else p=c.createTextNode(a);j.isPlainObject(d)&&(p.nodeType===l.ELEMENT_NODE?f.attr(p,d,!0):p.nodeType===l.DOCUMENT_FRAGMENT_NODE&&f.attr(p.childNodes,
d,!0));return p},_fixCloneAttributes:function(a,b){"textarea"===f.nodeName(a)&&(b.defaultValue=a.defaultValue,b.value=a.value)},_creators:{div:r},_defaultCreator:r,html:function(a,b,d){var a=f.query(a),c=a[0],e=!1,h,q;if(!c)return null;if(void 0===b)return c.nodeType===l.ELEMENT_NODE?c.innerHTML:c.nodeType===l.DOCUMENT_FRAGMENT_NODE?(d=n(c.ownerDocument),d.appendChild(c),d.innerHTML):null;b+="";if(!b.match(/<(?:script|style|link)/i)&&(!u||!b.match(g))&&!x[(b.match(t)||["",""])[1].toLowerCase()])try{for(h=
a.length-1;0<=h;h--)q=a[h],q.nodeType===l.ELEMENT_NODE&&(f.cleanData(q.getElementsByTagName("*")),q.innerHTML=b);e=!0}catch(s){}e||(b=f.create(b,0,c.ownerDocument,0),f.empty(a),f.append(b,a,d))},outerHtml:function(a,b,d){var a=f.query(a),g=a.length,c=a[0];if(!c)return null;if(void 0===b){if(A&&c.nodeType!==f.DOCUMENT_FRAGMENT_NODE)return c.outerHTML;b=n(c.ownerDocument);b.appendChild(f.clone(c,!0));return b.innerHTML}b+="";if(!b.match(/<(?:script|style|link)/i)&&A)for(d=g-1;0<=d;d--)c=a[d],c.nodeType===
l.ELEMENT_NODE&&(f.cleanData(c,1),c.outerHTML=b);else b=f.create(b,0,c.ownerDocument,0),f.insertBefore(b,a,d),f.remove(a)},remove:function(a,b){var c,g=f.query(a),e,h=j.Env.mods["event/dom/base"],q,h=h&&h.exports;for(q=g.length-1;0<=q;q--)c=g[q],!b&&c.nodeType===l.ELEMENT_NODE&&(e=j.makeArray(c.getElementsByTagName("*")),e.push(c),f.removeData(e),h&&h.detach&&h.detach(e)),d(c,c.parentNode)},clone:function(a,b,c,d){"object"===typeof b&&(d=b.deepWithDataAndEvent,c=b.withDataAndEvent,b=b.deep);var a=
f.get(a),g,h=f._fixCloneAttributes,q;if(!a)return null;q=a.nodeType;g=a.cloneNode(b);if(q===l.ELEMENT_NODE||q===l.DOCUMENT_FRAGMENT_NODE)h&&q===l.ELEMENT_NODE&&h(a,g),b&&h&&e(h,a,g);c&&(k(a,g),b&&d&&e(k,a,g));return g},empty:function(a){var a=f.query(a),b,c;for(c=a.length-1;0<=c;c--)b=a[c],f.remove(b.childNodes)},_nodeListToFragment:h});f.outerHTML=f.outerHtml;var D=f._creators,G=f.create,x={area:"map",thead:"table",td:"tr",th:"tr",tr:"tbody",tbody:"table",tfoot:"table",caption:"table",colgroup:"table",
col:"colgroup",legend:"fieldset"},w;for(w in x)(function(a){D[w]=function(b,c){return G("<"+a+">"+b+"</"+a+">",void 0,c)}})(x[w]);D.option=D.optgroup=function(a,b){return G('<select multiple="multiple">'+a+"</select>",void 0,b)};x.option=x.optgroup=1;return f});
KISSY.add("dom/base/data",["./api"],function(j,m){var n=m("./api"),r=j.Env.host,d="_ks_data_"+j.now(),e={},k={},h={applet:1,object:1,embed:1},f={hasData:function(c,b){if(c)if(void 0!==b){if(b in c)return!0}else if(!j.isEmptyObject(c))return!0;return!1}},i={hasData:function(c,b){return c==r?i.hasData(k,b):f.hasData(c[d],b)},data:function(c,b,a){if(c==r)return i.data(k,b,a);var e=c[d];if(void 0!==a)e=c[d]=c[d]||{},e[b]=a;else return void 0!==b?e&&e[b]:e=c[d]=c[d]||{}},removeData:function(c,b){if(c==
r)return i.removeData(k,b);var a=c[d];if(void 0!==b)delete a[b],j.isEmptyObject(a)&&i.removeData(c);else try{delete c[d]}catch(e){c[d]=void 0}}},l={hasData:function(c,b){var a=c[d];return!a?!1:f.hasData(e[a],b)},data:function(c,b,a){if(!h[c.nodeName.toLowerCase()]){var f=c[d];if(!f){if(void 0!==b&&void 0===a)return;f=c[d]=j.guid()}c=e[f];if(void 0!==a)c=e[f]=e[f]||{},c[b]=a;else return void 0!==b?c&&c[b]:c=e[f]=e[f]||{}}},removeData:function(c,b){var a=c[d],f;if(a)if(f=e[a],void 0!==b)delete f[b],
j.isEmptyObject(f)&&l.removeData(c);else{delete e[a];try{delete c[d]}catch(h){c[d]=void 0}c.removeAttribute&&c.removeAttribute(d)}}};j.mix(n,{__EXPANDO:d,hasData:function(c,b){for(var a=!1,d=n.query(c),f=0;f<d.length&&!(a=d[f],a=a.nodeType?l.hasData(a,b):i.hasData(a,b));f++);return a},data:function(c,b,a){var c=n.query(c),d=c[0];if(j.isPlainObject(b))for(var f in b)n.data(c,f,b[f]);else if(void 0===a){if(d)return d.nodeType?l.data(d,b):i.data(d,b)}else for(f=c.length-1;0<=f;f--)d=c[f],d.nodeType?
l.data(d,b,a):i.data(d,b,a)},removeData:function(d,b){var a=n.query(d),f,e;for(e=a.length-1;0<=e;e--)f=a[e],f.nodeType?l.removeData(f,b):i.removeData(f,b)},cleanData:function(d,b){var a=n.query(d),f,e,g=j.Env.mods["event/dom/base"],g=g&&g.exports;for(e=a.length-1;0<=e;e--)if(f=a[e],f.nodeType){var h=b&&j.makeArray(f.getElementsByTagName("*"))||[];h.push(f);f=0;for(var p=h.length;f<p;f++)l.removeData(h[f]);g&&g.detach&&g.detach(h)}else i.removeData(f)}});return n});
KISSY.add("dom/base/insertion",["./api"],function(j,m){function n(b,a){var d=[],e,g,q;for(e=0;b[e];e++)if(g=b[e],q=f(g),g.nodeType===k.DOCUMENT_FRAGMENT_NODE)d.push.apply(d,n(i(g.childNodes),a));else if("script"===q&&(!g.type||c.test(g.type)))g.parentNode&&g.parentNode.removeChild(g),a&&a.push(g);else{if(g.nodeType===k.ELEMENT_NODE&&!h.test(q)){q=[];var p,j,z=g.getElementsByTagName("script");for(j=0;j<z.length;j++)p=z[j],(!p.type||c.test(p.type))&&q.push(p);l.apply(b,[e+1,0].concat(q))}d.push(g)}return d}
function r(b){b.src?j.getScript(b.src):(b=j.trim(b.text||b.textContent||b.innerHTML||""))&&j.globalEval(b)}function d(b,a,d,c){b=e.query(b);c&&(c=[]);b=n(b,c);e._fixInsertionChecked&&e._fixInsertionChecked(b);var a=e.query(a),g,f,h,i,k=a.length;if((b.length||c&&c.length)&&k){b=e._nodeListToFragment(b);1<k&&(i=e.clone(b,!0),a=j.makeArray(a));for(g=0;g<k;g++)f=a[g],b&&(h=0<g?e.clone(i,!0):b,d(h,f)),c&&c.length&&j.each(c,r)}}var e=m("./api"),k=e.NodeType,h=/^(?:button|input|object|select|textarea)$/i,
f=e.nodeName,i=j.makeArray,l=[].splice,c=/\/(java|ecma)script/i;j.mix(e,{_fixInsertionChecked:null,insertBefore:function(b,a,c){d(b,a,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b)},c)},insertAfter:function(b,a,c){d(b,a,function(a,b){b.parentNode&&b.parentNode.insertBefore(a,b.nextSibling)},c)},appendTo:function(b,a,c){d(b,a,function(a,b){b.appendChild(a)},c)},prependTo:function(b,a,c){d(b,a,function(a,b){b.insertBefore(a,b.firstChild)},c)},wrapAll:function(b,a){a=e.clone(e.get(a),!0);
b=e.query(b);b[0].parentNode&&e.insertBefore(a,b[0]);for(var c;(c=a.firstChild)&&1===c.nodeType;)a=c;e.appendTo(b,a)},wrap:function(b,a){b=e.query(b);a=e.get(a);j.each(b,function(b){e.wrapAll(b,a)})},wrapInner:function(b,a){b=e.query(b);a=e.get(a);j.each(b,function(b){var c=b.childNodes;c.length?e.wrapAll(c,a):b.appendChild(a)})},unwrap:function(b){b=e.query(b);j.each(b,function(a){a=a.parentNode;e.replaceWith(a,a.childNodes)})},replaceWith:function(b,a){var c=e.query(b),a=e.query(a);e.remove(a,!0);
e.insertBefore(a,c);e.remove(c)}});j.each({prepend:"prependTo",append:"appendTo",before:"insertBefore",after:"insertAfter"},function(b,a){e[a]=e[b]});return e});
KISSY.add("dom/base/offset",["./api"],function(j,m){function n(c){var d,f=c.ownerDocument.body;if(!c.getBoundingClientRect)return{left:0,top:0};d=c.getBoundingClientRect();c=d[b];d=d[a];c-=i.clientLeft||f.clientLeft||0;d-=i.clientTop||f.clientTop||0;return{left:c,top:d}}function r(a,b){var c={left:0,top:0},f=l(a),e,h=a,b=b||f;do{if(f==b){var j=h;e=n(j);j=l(j);e.left+=d[s](j);e.top+=d[t](j)}else e=n(h);c.left+=e.left;c.top+=e.top}while(f&&f!=b&&(h=f.frameElement)&&(f=f.parent));return c}var d=m("./api"),
e=j.Env.host,k=j.UA,h=e.document,f=d.NodeType,i=h&&h.documentElement,l=d.getWindow,c=Math.max,b="left",a="top",s="scrollLeft",t="scrollTop";j.mix(d,{offset:function(a,b,c){if(void 0===b){var a=d.get(a),f;a&&(f=r(a,c));return f}c=d.query(a);for(f=c.length-1;0<=f;f--){var a=c[f],e=b;"static"===d.css(a,"position")&&(a.style.position="relative");var h=r(a),j={},i=void 0,k=void 0;for(k in e)i=parseFloat(d.css(a,k))||0,j[k]=i+e[k]-h[k];d.css(a,j)}},scrollIntoView:function(c,e,h,i){var k,n,m,r;if(m=d.get(c)){e&&
(e=d.get(e));e||(e=m.ownerDocument);e.nodeType===f.DOCUMENT_NODE&&(e=l(e));j.isPlainObject(h)&&(i=h.allowHorizontalScroll,r=h.onlyScrollIfNeeded,h=h.alignWithTop);i=void 0===i?!0:i;n=j.isWindow(e);var c=d.offset(m),s=d.outerHeight(m);k=d.outerWidth(m);var t,w,o,v;n?(n=e,t=d.height(n),w=d.width(n),v={left:d.scrollLeft(n),top:d.scrollTop(n)},n=c[b]-v[b],m=c[a]-v[a],k=c[b]+k-(v[b]+w),c=c[a]+s-(v[a]+t)):(t=d.offset(e),w=e.clientHeight,o=e.clientWidth,v={left:d.scrollLeft(e),top:d.scrollTop(e)},n=c[b]-
(t[b]+(parseFloat(d.css(e,"borderLeftWidth"))||0)),m=c[a]-(t[a]+(parseFloat(d.css(e,"borderTopWidth"))||0)),k=c[b]+k-(t[b]+o+(parseFloat(d.css(e,"borderRightWidth"))||0)),c=c[a]+s-(t[a]+w+(parseFloat(d.css(e,"borderBottomWidth"))||0)));if(r){if(0>m||0<c)!0===h?d.scrollTop(e,v.top+m):!1===h?d.scrollTop(e,v.top+c):0>m?d.scrollTop(e,v.top+m):d.scrollTop(e,v.top+c)}else(h=void 0===h?!0:!!h)?d.scrollTop(e,v.top+m):d.scrollTop(e,v.top+c);if(i)if(r){if(0>n||0<k)!0===h?d.scrollLeft(e,v.left+n):!1===h?d.scrollLeft(e,
v.left+k):0>n?d.scrollLeft(e,v.left+n):d.scrollLeft(e,v.left+k)}else void 0===h||h?d.scrollLeft(e,v.left+n):d.scrollLeft(e,v.left+k)}},docWidth:0,docHeight:0,viewportHeight:0,viewportWidth:0,scrollTop:0,scrollLeft:0});j.each(["Left","Top"],function(a,b){var c="scroll"+a;d[c]=function(h,j){if("number"===typeof h)return arguments.callee(e,h);var h=d.get(h),i,k,n,m;h&&h.nodeType===f.ELEMENT_NODE?void 0!==j?h[c]=parseFloat(j):i=h[c]:(m=l(h),void 0!==j?(j=parseFloat(j),k="Left"===a?j:d.scrollLeft(m),n=
"Top"===a?j:d.scrollTop(m),m.scrollTo(k,n)):(i=m["page"+(b?"Y":"X")+"Offset"],"number"!==typeof i&&(k=m.document,i=k.documentElement[c],"number"!==typeof i&&(i=k.body[c]))));return i}});j.each(["Width","Height"],function(a){d["doc"+a]=function(b){b=d.get(b);b=d.getDocument(b);return c(b.documentElement["scroll"+a],b.body["scroll"+a],d["viewport"+a](b))};d["viewport"+a]=function(b){var b=d.get(b),c=l(b),b=c["inner"+a];if(k.mobile&&b)return b;var b="client"+a,c=c.document,e=c.body,f=c.documentElement[b];
return"CSS1Compat"===c.compatMode&&f||e&&e[b]||f}});return d});
KISSY.add("dom/base/style",["./api","ua"],function(j,m){function n(a,b){return b.toUpperCase()}function r(a){-1!==a.indexOf("-")&&(a=a.replace(c,n));if(a in t)return t[a];if(!u||a in u)t[a]={propertyName:a,propertyNamePrefix:""};else{for(var b=a.charAt(0).toUpperCase()+a.slice(1),d,e=0;e<q;e++){var f=g[e];d=f+b;d in u&&(t[a]={propertyName:d,propertyNamePrefix:f})}t[a]=t[a]||null}return t[a]}function d(a){if(J[a])return J[a];var b=r(a);return b&&b.propertyName||a}function e(a,b,c){var d={},e=a.style,
f;for(f in b)d[f]=e[f],e[f]=b[f];c.call(a);for(f in b)e[f]=d[f]}function k(a,b,e){var f,h,g;if(!(3===a.nodeType||8===a.nodeType||!(f=a.style)))if(b=b.replace(c,n),g=I[b],b=d(b),void 0!==e){null===e||e===H?e=H:!isNaN(Number(e))&&!v[b]&&(e+=L);g&&g.set&&(e=g.set(a,e));if(void 0!==e){try{f[b]=e}catch(o){}e===H&&f.removeAttribute&&f.removeAttribute(b)}f.cssText||a.removeAttribute("style")}else{if(!g||!("get"in g&&void 0!==(h=g.get(a,!1))))h=f[b];return void 0===h?"":h}}function h(a){var b,c=arguments;
0!==a.offsetWidth?b=l.apply(void 0,c):e(a,C,function(){b=l.apply(void 0,c)});return b}function f(b,c,e,d){var f=0,h,g,o;for(g=0;g<c.length;g++)if(h=c[g])for(o=0;o<e.length;o++)f+=parseFloat(a._getComputedStyle(b,"border"===h?h+e[o]+"Width":h+e[o],d))||0;return f}function i(a){var b=a.ownerDocument,c;b.defaultView&&(c=b.defaultView.getComputedStyle(a,null));return c}function l(c,e,d){if(b.isWindow(c))return e===w?a.viewportWidth(c):a.viewportHeight(c);if(9===c.nodeType)return e===w?a.docWidth(c):a.docHeight(c);
var h=e===w?["Left","Right"]:["Top","Bottom"],g=e===w?c.offsetWidth:c.offsetHeight,o=i(c),j="border-box"===a._getComputedStyle(c,"boxSizing",o),k=0;if(null==g||0>=g){g=void 0;k=a._getComputedStyle(c,e,o);if(null==k||0>Number(k))k=c.style[e]||0;k=parseFloat(k)||0}void 0===d&&(d=j?D:A);e=void 0!==g||j;g=g||k;return d===A?e?g-f(c,["border","padding"],h,o):k:e?g+(d===D?0:d===F?-f(c,["border"],h,o):f(c,["margin"],h,o)):k+f(c,z.slice(d),h,o)}var c=/-([a-z])/ig,b=j,a=m("./api"),s=j.Env.host,t={},g=["Webkit",
"Moz","O","ms"],q=g.length,p=s.document||{},u=(p&&p.documentElement).style;m("ua");var z=["margin","border","padding"],A=-1,F=2,D=1,G=a.nodeName,x=/^margin/,w="width",o="display"+b.now(),v={fillOpacity:1,fontWeight:1,lineHeight:1,opacity:1,orphans:1,widows:1,zIndex:1,zoom:1},H="",L="px",M=/\d(?!px)[a-z%]+$/i,I={},J={},y={},B=r("userSelect"),E=B&&B.propertyName;J["float"]="cssFloat";b.mix(a,{_cssHooks:I,_cssProps:J,_getComputedStyle:function(b,c,e){var f="",h,g;h=b.ownerDocument;c=d(c);if(e=e||h.defaultView.getComputedStyle(b,
null))f=e.getPropertyValue(c)||e[c];""===f&&!a.contains(h,b)&&(f=b.style[c]);a._RE_NUM_NO_PX.test(f)&&x.test(c)&&(g=b.style,b=g.width,c=g.minWidth,h=g.maxWidth,g.minWidth=g.maxWidth=g.width=f,f=e.width,g.width=b,g.minWidth=c,g.maxWidth=h);return f},style:function(c,e,d){var c=a.query(c),f,h=c[0];if(b.isPlainObject(e))for(f in e)for(h=c.length-1;0<=h;h--)k(c[h],f,e[f]);else{if(void 0===d)return f="",h&&(f=k(h,e,d)),f;for(h=c.length-1;0<=h;h--)k(c[h],e,d)}},css:function(e,d,f){var e=a.query(e),h=e[0],
g;if(b.isPlainObject(d))for(g in d)for(h=e.length-1;0<=h;h--)k(e[h],g,d[g]);else{d=d.replace(c,n);g=I[d];if(void 0===f){f="";if(h&&(!g||!("get"in g&&void 0!==(f=g.get(h,!0)))))f=a._getComputedStyle(h,d);return"undefined"===typeof f?"":f}for(h=e.length-1;0<=h;h--)k(e[h],d,f)}},show:function(b){var b=a.query(b),c,e,d;for(d=b.length-1;0<=d;d--)if(e=b[d],e.style.display=a.data(e,o)||H,"none"===a.css(e,"display")){c=e.tagName.toLowerCase();var f=void 0,h=y[c],g=void 0;y[c]||(f=p.body||p.documentElement,
g=p.createElement(c),a.prepend(g,f),h=a.css(g,"display"),f.removeChild(g),y[c]=h);c=h;a.data(e,o,c);e.style.display=c}},hide:function(b){var b=a.query(b),c,e;for(e=b.length-1;0<=e;e--){c=b[e];var d=c.style,f=d.display;"none"!==f&&(f&&a.data(c,o,f),d.display="none")}},toggle:function(b){var b=a.query(b),c,e;for(e=b.length-1;0<=e;e--)c=b[e],"none"===a.css(c,"display")?a.show(c):a.hide(c)},addStyleSheet:function(b,c,e){"string"===typeof b&&(e=c,c=b,b=s);var b=a.getDocument(b),d;if(e&&(e=e.replace("#",
H)))d=a.get("#"+e,b);d||(d=a.create("<style>",{id:e},b),a.get("head",b).appendChild(d),d.styleSheet?d.styleSheet.cssText=c:d.appendChild(b.createTextNode(c)))},unselectable:!E?function(c){var c=a.query(c),e,d,f=0,h,g;for(d=c.length-1;0<=d;d--){e=c[d];g=e.getElementsByTagName("*");e.setAttribute("unselectable","on");for(h=["iframe","textarea","input","select"];e=g[f++];)b.inArray(G(e),h)||e.setAttribute("unselectable","on")}}:function(b){for(var b=a.query(b),c=b.length-1;0<=c;c--)b[c].style[E]="none"},
innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,width:0,height:0});b.each([w,"height"],function(c){a["inner"+b.ucfirst(c)]=function(b){return(b=a.get(b))&&h(b,c,F)};a["outer"+b.ucfirst(c)]=function(b,e){var d=a.get(b);return d&&h(d,c,e?0:D)};var e=c===w?["Left","Right"]:["Top","Bottom"];a[c]=function(b,d){var g=a.get(b);if(void 0!==d){if(g){var o=i(g);"border-box"===a._getComputedStyle(g,"boxSizing",o)&&(d+=f(g,["padding","border"],e,o));return a.css(g,c,d)}}else return g&&h(g,c,A)};I[c]={get:function(b,
a){var e;a&&(e=h(b,c)+"px");return e}}});var C={position:"absolute",visibility:"hidden",display:"block"};b.each(["left","top"],function(b){I[b]={get:function(c,e){var d,f,h;if(e){h=a.css(c,"position");if("static"===h)return"auto";d=a._getComputedStyle(c,b);if((f="auto"===d)&&"relative"===h)return"0px";if(f||M.test(d)){h={top:0,left:0};if("fixed"===a.css(c,"position"))f=c.getBoundingClientRect();else{for(d=c.offsetParent||(c.ownerDocument||p).body;d&&!N.test(d.nodeName)&&"static"===a.css(d,"position");)d=
d.offsetParent;f=a.offset(c);h=a.offset(d);h.top+=parseFloat(a.css(d,"borderTopWidth"))||0;h.left+=parseFloat(a.css(d,"borderLeftWidth"))||0}f.top-=parseFloat(a.css(c,"marginTop"))||0;f.left-=parseFloat(a.css(c,"marginLeft"))||0;d={top:f.top-h.top,left:f.left-h.left}[b]+"px"}}return d}}});var N=/^(?:body|html)$/i;return a});
KISSY.add("dom/base/selector",["./api"],function(j,m){function n(b){var a=this.length,c;for(c=0;c<a&&!1!==b(this[c],c);c++);}function r(b){b=b.substr(1);if(!b)throw Error("An invalid or illegal string was specified for selector.");return b}function d(a){return function(e){var d=c._getElementById(a,b);return d&&c._contains(e,d)?[d]:[]}}function e(b){return function(a){return t(a,b)}}function k(b){return function(a){return a.getElementsByTagName(b)}}function h(a,f){var i,l,m="string"===typeof a,s=void 0!==
f?h(f):(l=1)&&[b],u=s.length;if(a)if(m){a=w(a);if(l)if("body"===a)i=[b.body];else if(A.test(a))i=q(t(b,RegExp.$1));else if(G.test(a))i=(l=c._getElementById(RegExp.$2,b))&&l.nodeName.toLowerCase()===RegExp.$1?[l]:[];else if(F.test(a))i=(l=c._getElementById(a.substr(1),b))?[l]:[];else if(D.test(a))i=q(b.getElementsByTagName(a));else if(!a.match(/,|\+|=|~|\[|\]|:|>|\||\$|\^|\*|\(|\)|[\w-]+\.[\w-]+|[\w-]+#[\w-]+/)){i=a.split(/\s+/);var y=s,B,E;l=0;for(m=i.length;l<m;l++){B=i;E=l;var C;C=i[l];var x=C.charAt(0);
C="#"===x?d(r(C)):"."===x?e(r(C)):k(C);B[E]=C}l=0;for(m=i.length;l<m;l++){C=i[l];var x=[],K;B=0;for(E=y.length;B<E;B++)K=C(y[B]),x.push.apply(x,q(K));y=x;if(!y.length)break}i=y&&1<y.length?c.unique(y):y}if(!i){i=[];for(l=0;l<u;l++)z.apply(i,c._selectInternal(a,s[l]));1<i.length&&1<u&&c.unique(i)}}else{if(i=a.nodeType||j.isWindow(a)?[a]:a.getDOMNodes?a.getDOMNodes():g(a)?a:p(a)?q(a):[a],!l){m=i;B=m.length;i=[];for(l=0;l<B;l++)for(y=0;y<u;y++)if(c._contains(s[y],m[l])){i.push(m[l]);break}}}else i=[];
i.each=n;return i}function f(b,a){var c=b&&i(b,"class");return c&&(c=c.replace(/[\r\t\n]/g,u))&&-1<(u+c+u).indexOf(u+a+u)}function i(b,a){var c=b&&b.getAttributeNode(a);if(c&&c.specified)return c.nodeValue}function l(b,a){return"*"===a||b.nodeName.toLowerCase()===a.toLowerCase()}var c=m("./api"),b=j.Env.host.document,a=b.documentElement,s=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector,t,g=j.isArray,q=j.makeArray,p=c.isDomNodeList,u=" ",z=Array.prototype.push,
A=/^\.([\w-]+)$/,F=/^#([\w-]+)$/,D=/^([\w-])+$/,G=/^([\w-]+)#([\w-]+)$/,x=/^(?:#([\w-]+))?\s*([\w-]+|\*)?\.?([\w-]+)?$/,w=j.trim;t="getElementsByClassName"in b?function(b,a){return b.getElementsByClassName(a)}:function(b,a){var c=[],e=b.getElementsByTagName("*"),d,f,a=" "+a+" ";for(d=0;d<e.length;d++)f=e[d],-1<(" "+(f.className||f.getAttribute("class"))+" ").indexOf(a)&&c.push(f);return c};j.mix(c,{_compareNodeOrder:function(b,a){return!b.compareDocumentPosition||!a.compareDocumentPosition?b.compareDocumentPosition?
-1:1:b.compareDocumentPosition(a)&4?-1:1},_getElementsByTagName:function(b,a){return q(a.querySelectorAll(b))},_getElementById:function(b,a){return a.getElementById(b)},_getSimpleAttr:i,_isTag:l,_hasSingleClass:f,_matchesInternal:function(b,a){for(var c=[],e=0,d,f=a.length;e<f;e++)d=a[e],s.call(d,b)&&c.push(d);return c},_selectInternal:function(b,a){return q(a.querySelectorAll(b))},query:h,get:function(b,a){return h(b,a)[0]||null},unique:function(){function b(e,d){return e===d?(a=!0,0):c._compareNodeOrder(e,
d)}var a,e=!0;[0,0].sort(function(){e=!1;return 0});return function(c){a=e;c.sort(b);if(a)for(var d=1,f=c.length;d<f;)c[d]===c[d-1]?(c.splice(d,1),--f):d++;return c}}(),filter:function(b,a,e){var b=h(b,e),d,g,k,m,e=[];if("string"===typeof a&&(a=w(a))&&(k=x.exec(a)))d=k[1],g=k[2],m=k[3],d?d&&!g&&!m&&(a=function(a){return i(a,"id")===d}):a=function(a){var b=!0,c=!0;g&&(b=l(a,g));m&&(c=f(a,m));return c&&b};return e="function"===typeof a?j.filter(b,a):c._matchesInternal(a,b)},test:function(a,b,e){a=h(a,
e);return a.length&&c.filter(a,b,e).length===a.length}});return c});
KISSY.add("dom/base/traversal",["./api"],function(j,m){function n(d,f,i,l,c,b,a){if(!(d=e.get(d)))return null;if(0===f)return d;b||(d=d[i]);if(!d)return null;c=c&&e.get(c)||null;void 0===f&&(f=1);var b=[],m=j.isArray(f),n,g;"number"===typeof f&&(n=0,g=f,f=function(){return++n===g});for(;d&&d!==c;){if((d.nodeType===k.ELEMENT_NODE||d.nodeType===k.TEXT_NODE&&a)&&r(d,f)&&(!l||l(d)))if(b.push(d),!m)break;d=d[i]}return m?b:b[0]||null}function r(d,f){if(!f)return!0;if(j.isArray(f)){var i,k=f.length;if(!k)return!0;
for(i=0;i<k;i++)if(e.test(d,f[i]))return!0}else if(e.test(d,f))return!0;return!1}function d(d,f,i,l){var c=[],b,a;if((b=d=e.get(d))&&i)b=d.parentNode;if(b){i=j.makeArray(b.childNodes);for(b=0;b<i.length;b++)a=i[b],(l||a.nodeType===k.ELEMENT_NODE)&&a!==d&&c.push(a);f&&(c=e.filter(c,f))}return c}var e=m("./api"),k=e.NodeType;j.mix(e,{_contains:function(d,e){return!!(d.compareDocumentPosition(e)&16)},closest:function(d,e,i,j){return n(d,e,"parentNode",function(c){return c.nodeType!==k.DOCUMENT_FRAGMENT_NODE},
i,!0,j)},parent:function(d,e,i){return n(d,e,"parentNode",function(d){return d.nodeType!==k.DOCUMENT_FRAGMENT_NODE},i,void 0)},first:function(d,f,i){d=e.get(d);return n(d&&d.firstChild,f,"nextSibling",void 0,void 0,!0,i)},last:function(d,f,i){d=e.get(d);return n(d&&d.lastChild,f,"previousSibling",void 0,void 0,!0,i)},next:function(d,e,i){return n(d,e,"nextSibling",void 0,void 0,void 0,i)},prev:function(d,e,i){return n(d,e,"previousSibling",void 0,void 0,void 0,i)},siblings:function(e,f,i){return d(e,
f,!0,i)},children:function(e,f){return d(e,f,void 0)},contents:function(e,f){return d(e,f,void 0,1)},contains:function(d,f){d=e.get(d);f=e.get(f);return d&&f?e._contains(d,f):!1},index:function(d,f){var i=e.query(d),l,c=0;l=i[0];if(!f){i=l&&l.parentNode;if(!i)return-1;for(;l=l.previousSibling;)l.nodeType===k.ELEMENT_NODE&&c++;return c}c=e.query(f);return"string"===typeof f?j.indexOf(l,c):j.indexOf(c[0],i)},equals:function(d,f){d=e.query(d);f=e.query(f);if(d.length!==f.length)return!1;for(var i=d.length;0<=
i;i--)if(d[i]!==f[i])return!1;return!0}});return e});KISSY.add("dom/base","./base/api,./base/attr,./base/class,./base/create,./base/data,./base/insertion,./base/offset,./base/style,./base/selector,./base/traversal".split(","),function(j,m){var n=m("./base/api");m("./base/attr");m("./base/class");m("./base/create");m("./base/data");m("./base/insertion");m("./base/offset");m("./base/style");m("./base/selector");m("./base/traversal");j.mix(j,{DOM:n,get:n.get,query:n.query});return n});
